package com.shangxian.giveithome.utils;

import com.shangxian.giveithome.entity.petCard.inputParam.TimeParam;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/**
 * @author coderFu
 * @create 2021/5/3
 * 时间处理封装
 */

public class TimeDealUtils {


    /**
     * 获取不同格式的时间
     * @return
     */
    public static TimeParam get(){
        TimeParam timeParam = new TimeParam();
        Date now = new Date();
        SimpleDateFormat sdf = new SimpleDateFormat("MM.dd ");
        String month = sdf.format(now);
        SimpleDateFormat sdf2 = new SimpleDateFormat("HH:mm");
        String hour = sdf2.format(now);
        timeParam.setScanYear(Calendar.getInstance().get(Calendar.YEAR));
        timeParam.setScanMonth(month);
        timeParam.setScanHour(hour);
        timeParam.setScanTime(now);
        return timeParam;
    }







}
